package properties;
/*

 */
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;

public class Demo2 {
    public static void main(String[] args) throws IOException {
        Properties prop = new Properties();
        FileInputStream fis = new FileInputStream("HDay09\\C.properties");
        //加载，将文件加载到prop中
        prop.load(fis);
        fis.close();
        System.out.println(prop);
    }

    private static void loadProp() throws IOException {
        Properties prop = new Properties();
        prop.setProperty("name", "John");

        FileOutputStream fos = new FileOutputStream("HDay09\\C.properties");
        //store方法将键值对中的数据写出到文件里边去，第二个参数是注释

        prop.store(fos,"周琦");
        fos.close();
    }
}
